package com.fly.mskillclient;

import java.util.Date;
import java.util.concurrent.TimeUnit;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
// springboot
@SpringBootApplication
@RestController
// eureka
@EnableEurekaClient
@EnableDiscoveryClient
public class MSkillClientApplication {

	public static void main(String[] args) {
		SpringApplication.run(MSkillClientApplication.class, args);
	}

	@GetMapping("/test")
	public String test() throws InterruptedException {
		System.err.println(new Date().toGMTString());
		System.err.println("skill1");
		// 测试  feign 的超时
		TimeUnit.SECONDS.sleep(10L);
		return "skill1";
	}
	
	@PostMapping("/hello2")
	public String hello2(@RequestBody User user) {
		System.err.println(user.toString());
		return user.toString();
	}
	
	
}
